//
//  ScroolSimpleViewController.m
//  UITest
//
//  Created by wp w on 12-6-7.
//  Copyright (c) 2012年 __MyCompanyName__. All rights reserved.
//

#import "ScroolSimpleViewController.h"

@interface ScroolSimpleViewController ()

@end

@implementation ScroolSimpleViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view.
    
    //一个可以使用多点触摸缩放的scrollview
    //新建scrollView
    CGRect scrollFrame = CGRectMake(20,90,280,280);
	UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:scrollFrame];
	
    //新建一个大的imgview
	UIImage *bigImage = [UIImage imageNamed:@"appleLogo.jpg"];
	UIImageView *largeImageView = [[UIImageView alloc] initWithImage:bigImage];
	
    //把这个大的imgview添加到scrollview中
	[scrollView addSubview:largeImageView];
    //设置滚动视图包含的子视图大小
	scrollView.contentSize = largeImageView.frame.size; //important!
	
    //把scrollview添加到self.view中
	[self.view addSubview:scrollView];
	
	[scrollView release];
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
